Implement SHA3 hash benchmarks (224/256/384/512) - #499
Merged
Conversation
kojiws
force-pushed
the
fix_sha3_benchmark
branch
from
July 29, 2026 06:48
e83f149 to
d7727b1
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #499
No scan targets match the changed files in this PR. Review skipped.
bigbrett
requested changes
Aug 3, 2026
bigbrett
approved these changes
Aug 7, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enables SHA3 hashing benchmarks across all four digest sizes (224/256/384/512) and both DMA/non-DMA paths, replacing prior stubs that caused SHA3 benchmarks to be skipped. It also updates the benchmark registration so SHA3 results report throughput (bytes/sec) like other hash benchmarks.
Changes:
- Adds per-variant SHA3 benchmark module indices (224/256/384/512, plus DMA variants) behind the appropriate wolfSSL feature macros.
- Implements SHA3 benchmark modules using wolfCrypt
wc_Sha3_*APIs with a shared internal helper to reduce duplication. - Switches SHA3 benchmark throughput type from
BENCH_THROUGHPUT_NONEtoBENCH_THROUGHPUT_XBPSso throughput is reported.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| benchmark/wh_bench.c | Registers SHA3-224/256/384/512 (+ DMA) modules conditionally and enables throughput reporting for SHA3 benches. |
| benchmark/bench_modules/wh_bench_mod_sha3.c | Implements SHA3 benchmark functions for 224/256/384/512 and DMA/non-DMA via a shared helper and per-variant ops table. |
| benchmark/bench_modules/wh_bench_mod_all.h | Adds prototypes for the new SHA3-224/384/512 benchmark module functions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enables the SHA3 benchmarks in
benchmark/bench_modules/wh_bench_mod_sha3.c,which were stubs returning
WH_ERROR_NOTIMPLand silently-> SKIPPED.Covers all four variants (224/256/384/512), DMA and non-DMA. SHA3 entries
switched from
BENCH_THROUGHPUT_NONEtoXBPSso throughput is reported.HMAC-SHA3 is out of scope and stays
SKIPPED.Test
make DMA=1: all eight SHA3 rows report; previously two wereSKIPPEDandsix did not exist.
make(non-DMA): the four non-DMA rows report.